1. Field
The present disclosure pertains to the field of processing apparatuses and systems that process sequences of instructions or the like, as well as certain instruction sequences to program such apparatuses and/or systems. Some embodiments relate to monitoring and/or responding to conditions or events within execution resources of such processing apparatuses.
2. Description of Related Art
Various mechanism are presently used to change the flow of control (i.e., the processing path or instruction sequence being followed) in a processing system. For example, a jump instruction in a program sequence explicitly and precisely causes a jump to a new address. The jump instruction is an example of an explicit change of the control flow because the instruction directs the processor to jump to a location and continue executing at that point. A traditional jump instruction is “precise” (or synchronous) because the jump occurs as a direct result of execution of the jump instruction.
Another traditional example of a change in the flow of control is an interrupt. An interrupt may be an external signal provided to an apparatus such as a processor. The processor may respond by jumping to an interrupt handler, a routine that handles the event(s) signaled by a particular interrupt. Interrupts are typically also relatively precise in that they are recognized and acted upon by a processor within a particular window of time in relation to their receipt. In particular, interrupts are often serviced at the next instruction boundary after they are received internally. In some cases, only the operating system or other software operating at a high privilege level is allowed to mask interrupts, so a user program may have no opportunity to enable or disable these control flow changing events.
Another traditional example of a change in the flow of control occurs in response to an exception. An exception typically reflects a predefined architectural condition such as a result of a mathematical instruction meeting certain criteria (denormal, underflow, overflow, not a number, etc.). Some exceptions can be masked, for example, by setting a bit in a control register. If an exception occurs and is not masked, then an exception handler is called to handle the exception.
Another technique that changes the flow of control of a processor is the use of breakpoints. Breakpoints are typically used in debugging. A particular instruction address may be programmed into a breakpoint register. The processor may do various acts (other than continue with the program as usual) when a breakpoint is active and the target address is reached. Breakpoints allow single-stepping through a program, among other things.
Multi-threading is a technique by which processor hardware may be utilized by multiple different threads. Multi-threaded processors may switch between threads for a variety of reasons. For example, a processor may have an algorithm that automatically switches between available threads. Other processors use switch-on-event multithreading (SoEMT), whereby certain events such as a cache miss may give rise to a thread switch. Thread switching can be considered a change of control flow because the processor switches the sequence or stream which it executes.
In one prior art reference, a quiesce instruction is detailed (see U.S. Pat. No. 6,493,741). In one example, the quiesce instruction stops processing in one thread until either a timer expires or a memory write to a memory location occurs. Therefore, an instruction such as the quiesce instruction may itself trigger the temporary cessation of processing of the thread containing the quiesce instruction and a switch to another thread.